package com.neusoft.elmboot.controller;

import com.neusoft.elmboot.po.Image;
import com.neusoft.elmboot.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ImageController")
public class ImageController {

    @Autowired
    private ImageService imageService;

    @RequestMapping("/listAllImage")
    public List<Image> listAllImage() throws Exception {
        return imageService.listAllImage();
    }

    @RequestMapping("/listImageById")
    public String listImageById(Image image) throws Exception {
        return imageService.listImageById(image.getImgId());
    }

}
